Add mesh boundary gluing (post facial-adjacency overhaul) - #253
Conversation
d060ad9 to
0511de1
Compare
0511de1 to
f556ec5
Compare
f556ec5 to
6ae6b0e
Compare
6ae6b0e to
b18b5a7
Compare
|
I think this is ready for a look (apart from the one TODO I mentioned above). |
inducer
left a comment
There was a problem hiding this comment.
Thanks! This looks super clean. I like it a lot. Here's some initial progress on reviewing this.
| transformation (though the vertex ordering need not be the same). | ||
|
|
||
| :arg glued_boundary_mappings: a :class:`list` of tuples | ||
| *(btag_m, btag_n, aff_map, tol)* which each specify a mapping between two |
There was a problem hiding this comment.
I think four is big enough to warrant a dataclass. What do you think?
There was a problem hiding this comment.
I ended up just grouping the first 3 arguments and leaving the tolerance separate. (4664575)
| glued_boundary_mappings = [] | ||
| for btag_m, btag_n, aff_map, tol in partial_glued_boundary_mappings: | ||
| glued_boundary_mappings.append((btag_m, btag_n, aff_map, tol)) | ||
| if (btag_n, btag_m) not in partial_btag_pairs: |
There was a problem hiding this comment.
I actually went the other direction and banned passing both. I like the convenience of just passing one mapping; the code can figure out the inverse.
| # FIXME: This tree-based approach is probably slow; see if there's a way to do | ||
| # something like this using numpy constructs |
There was a problem hiding this comment.
We could check how slow the O(N^2) think with numpy is and where the cross-over point with the tree is. A somewhat numpy-ish process to do this is here:
meshmode/meshmode/discretization/connection/direct.py
Lines 296 to 309 in d136649
Note that there's a Python loop left still.
There was a problem hiding this comment.
I added the numpy version. (06565f4) On my laptop the numpy version is faster when the number of boundary vertices is less than 10k or so.
Co-authored-by: Andreas Klöckner <inform@tiker.net>
…post-adj-overhaul
| is the tolerance allowed between the vertex coordinates of *btag_n* and the | ||
| transformed vertex coordinates of *btag_m* when attempting to match the two. | ||
| """ | ||
| glued_boundary_mappings = _complete_glued_boundary_mappings( |
There was a problem hiding this comment.
The way it's currently structured, I think this calls _match_boundary_faces twice for each input "mapping pair". (Once for a->b and once for b->a.) Eliminate or add a comment to justify.
| h = 1/mesh_par | ||
| else: | ||
| mesh = mgen.generate_annular_cylinder_slice_mesh( | ||
| mesh_par, (1, 2, 3), 0.5, 1, periodic=True) |
There was a problem hiding this comment.
f is not periodic on that mesh though?
There was a problem hiding this comment.
Turns out it is, just because the mesh is symmetric about the x-axis and so is f.
02a995c to
7252fee
Compare
|
Unsubscribing... @-mention or request review once it's ready for a look or needs attention. |
…post-adj-overhaul
7252fee to
a75aa7c
Compare
not needed anymore, I think
a75aa7c to
06565f4
Compare
inducer
left a comment
There was a problem hiding this comment.
LGTM, thanks! I'll apply the one suggestion.
To avoid giant temporaries.
Rebase failed
|
@majosm Would you like to manually rebase or are you OK with me squashing this? |
Looks OK to squash I think. |
|
Sounds good. In it goes! Thanks again for your work on this. |
Possiblysupersedes #204,pending review/merge of the changes from #252.